<!DOCTYPE html>
<html lang="en">
  <head>
      <meta charset="UTF-8">
      <title>条件运算符</title>
    <script type="text/javascript">
      var res = (10 > 1) ? "lmy" : 800;
      alert(res);//lmy
    </script>
  </head>

  <body>

  </body>
</html>